home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / XLisp-Stat / Functions / rockplot.lsp < prev    next >
Text File  |  1990-10-11  |  828b  |  21 lines

  1. ; book pp.316-317
  2.  
  3. (require "functions/pressbutton.lsp")
  4.  
  5. (defmeth spin-proto :rock-plot (&optional (a .15))
  6.    (let* ((angle (send self :angle))
  7.           (k (round (/ a angle))))
  8.       (dotimes (i k) (send self :rotate-2 0 2 angle))
  9.       (dotimes (i (* 2 k)) (send self :rotate-2 0 2 (- angle)))
  10.       (dotimes (i k) (send self :rotate-2 0 2 angle))))
  11. (defproto spin-rock-control-proto () () button-overlay-proto)
  12. (send spin-rock-control-proto :title "Rock Plot")
  13. (defmeth spin-rock-control-proto :do-action (first)
  14.   (send (send self :graph) :rock-plot))
  15. (defmeth spin-rock-control-proto :resize ()
  16.   (let* ((graph (send self :graph))
  17.          (size (send self :size))
  18.          (width (send graph :canvas-width))
  19.          (height (send graph :canvas-height)))
  20.      (send self :location (- (list width (+ 0 height)) size))))
  21.